package cn.ecommerce.course.module.users.controller.admin.users.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.time.LocalDate;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import cn.idev.excel.annotation.*;
import cn.ecommerce.course.framework.excel.core.annotations.DictFormat;
import cn.ecommerce.course.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 电商平台用户 Response VO")
@Data
@ExcelIgnoreUnannotated
public class UsersRespVO {

    @Schema(description = "用户唯一标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "3932")
    @ExcelProperty("用户唯一标识")
    private Long id;

    @Schema(description = "登录用户名", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
    @ExcelProperty("登录用户名")
    private String account;

    @Schema(description = "手机号")
    @ExcelProperty("手机号")
    private String phone;

    @Schema(description = "邮箱")
    @ExcelProperty("邮箱")
    private String email;

    @Schema(description = "用户昵称", example = "李四")
    @ExcelProperty("用户昵称")
    private String nickname;

    @Schema(description = "头像URL")
    @ExcelProperty("头像URL")
    private String avatar;

    @Schema(description = "账号状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @ExcelProperty(value = "账号状态", converter = DictConvert.class)
    @DictFormat("account_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer status;

    @Schema(description = "性别")
    @ExcelProperty(value = "性别", converter = DictConvert.class)
    @DictFormat("system_user_sex") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Integer gender;

    @Schema(description = "生日")
    @ExcelProperty("生日")
    private LocalDate birthday;

    @Schema(description = "最近登录时间")
    @ExcelProperty("最近登录时间")
    private LocalDateTime lastLoginTime;

    @Schema(description = "最近登录IP")
    @ExcelProperty("最近登录IP")
    private String loginIp;

}
